package com.xtxk.service.control;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.xtxk.common.constant.CommonConstant;

@Service
public class ControlService {

	/**
	 * 控制云台方位
	 * @return
	 */
	public Map<String, Object> ptzCtrlDirection(){
		Map<String, Object> map = new HashMap<>();
		if (CommonConstant.status) {
			map.put("resourceID", "D000000000000032");
			map.put("resourceCH", 0);
			map.put("direction", "u");
			map.put("speed", 127);
			return map;
		}
		return map;
	}
	
	/**
	 * 控制镜头变倍
	 * @return
	 */
	public Map<String, Object> ptzCtrlZoom(){
		Map<String, Object> map = new HashMap<>();
		if (CommonConstant.status) {
			map.put("resourceID", "D000000000000032");
			map.put("resourceCH", 0);
			map.put("zoom", "in");
			map.put("speed", 127);
			return map;
		}
		return map;
	}
	
	/**
	 * 控制镜头聚焦
	 * @return
	 */
	public Map<String, Object> ptzCtrlFocus(){
		Map<String, Object> map = new HashMap<>();
		if (CommonConstant.status) {
			map.put("resourceID", "D000000000000032");
			map.put("resourceCH", 0);
			map.put("focus", "near");
			map.put("speed", 127);
			return map;
		}
		return map;
	}
	
	/**
	 * 控制镜头光圈
	 * @return
	 */
	public Map<String, Object> ptzCtrlAperture(){
		Map<String, Object> map = new HashMap<>();
		if (CommonConstant.status) {
			map.put("resourceID", "D000000000000032");
			map.put("resourceCH", 0);
			map.put("aperture", "+");
			map.put("speed", 127);
			return map;
		}
		return map;
	}
}
